package start.controller;


import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import start.model.City;
import start.model.County;
import start.model.Province;
import start.service.IAreaService;

import javax.annotation.Resource;
import java.util.List;

@RestController
public class AreaCtrl {
	@Resource
	private IAreaService service;

	@RequestMapping("/area/provinces")
	public List<Province> queryProvince(){
		
		return this.service.findProvinces();
	}
	
	@RequestMapping("/area/citys/{code}")
	public List<City> queryCitys(@PathVariable("code") String code){
		
		return this.service.findCitys(code);
	}
	
	@RequestMapping("/area/countys/{code}")
	public List<County> queryCountys(@PathVariable("code") String code){
		
		return this.service.findCountrys(code);
	}
}
